#ifndef __DEVICE_DISCOVERY_H__
#define __DEVICE_DISCOVERY_H__

#define MSG_FIXED_HEADER 0xAA55AA55
#define MSG_TYPE_REQ 1
#define MSG_TYPE_RSP 2
#define MSG_TYPE_ACK 3


#define STAT_IDLE 1
#define STAT_RECV_REQ 2
#define STAT_SENT_RSP 3
#define STAT_RECV_ACK 4

#pragma pack(1)  
typedef struct {
    unsigned int header;
    unsigned char type;
    unsigned short crc16;
}msg_req_t;

typedef struct {
    unsigned int header;
    unsigned char type;
    unsigned short port;
    unsigned char mac[6];
    char soft_version[16];
    char fpga_version[16];
    unsigned short crc16;
}msg_rsp_t;

typedef struct {
    unsigned int header;
    unsigned char type;
    unsigned int ip;
    unsigned short crc16;
}msg_ack_t;
#pragma pack()  

#endif /* __DEVICE_DISCOVERY_H__ */

